<?php
$this->jQuery()->enable();
$this->headLink()->prependStylesheet('/js/jquery/css/themes/base/jquery.ui.all.css');
$this->headScript() ->appendFile('/js/jquery/jquery-ui-1.8.12.custom.min.js')
					->appendFile('/js/jquery/ui/jquery.ui.widget.js')
					->appendFile('/js/jquery/ui/jquery.ui.core.js')					
					->appendFile('/js/jquery/ui/jquery.ui.dialog.js')					
					->appendFile('/js/jquery/ui/jquery.ui.draggable.js')
					->appendFile('/js/jquery/ui/jquery.ui.position.js')
					->appendFile('/js/jquery/ui/jquery.ui.resizable.js')
					->appendFile('/js/jquery/ui/jquery.ui.mouse.js')
					->appendFile('/js/jquery/ui/jquery.ui.button.js')					
					->appendFile('/js/geralAjax.js');
					

$this->headScript()->appendScript("
$(document).ready(function(){
 $('#confirme').dialog({
        height: 140,
        autoOpen: false,
        modal: true,
        resizable: false});
        $('input#Pesquisar').button();
        $('input#add_email_lista').button();
		$('input#PesquisaAvancada').button();
		$('#box-busca-avancada-emails').hide();  		
      
});");
$translator = Zend_Registry::get('translator');
?>
<div id="flash-messeger"><?php echo $this->flashMessenger(); ?></div>
<div id="mapa">Configurações de Base/<span>Buscar E-mail</span></div>
<form action="<?php echo $this->form->getAction();?>" method="<?php echo $this->form->getMethod(); ?>" enctype="<?php echo $this->form->getEnctype(); ?>">
<table cellspacing="0" cellpadding="0" width="700px" border="0" style="text-align: right;">
	<tr>
		<td><?php echo $this->form->email;?></td>
		<td width="10px"><?php echo $this->form->Buscar;?></td>
		<td><?php echo $this->form->tipo;?></td>
		<td width="10px"><input onclick="javascript:$('#box-busca-avancada-emails').show('blind');" type="button" name="PesquisaAvancada" id="PesquisaAvancada" value="Pesquisa Avançada" title="Pesquisa Avançada" style="font-weight:bold;" /></td>
	</tr>
</table>
</form>
<div id="box-busca-avancada-emails">
<div id="fechar-show"><a title="Fechar" href="javascript:void();" onclick="javascript:$('#box-busca-avancada-emails').hide('blind',300);">x</a></div>
<form action="<?php echo $this->formAvancado->getAction();?>" method="<?php echo $this->formAvancado->getMethod(); ?>" enctype="<?php echo $this->form->getEnctype(); ?>">
<table align="right" cellspacing="2" cellpadding="1" width="520px" border="0" style="text-align: right;">
	<tr>
		<td><?php echo $this->formAvancado->hotmail;?><img title="@hotmail.com" alt="@hotmail.com" src="/imagens/icones-emails/hotmail.png"/></td>
		<td> <?php echo $this->formAvancado->gmail;?><img title="@gmail.com" alt="@gmail.com" src="/imagens/icones-emails/gmail.png"/></td>	
		<td><?php echo $this->formAvancado->yahoo;?><img title="@yahoo.com" alt="@yahoo.com" src="/imagens/icones-emails/yahoo.png"/></td>
		<td><?php echo $this->formAvancado->aol;?><img title="@aol.com" alt="@aol.com" src="/imagens/icones-emails/aol.png"/></td>
		<td><?php echo $this->formAvancado->msn;?><img title="@msn.com" alt="@msn.com" src="/imagens/icones-emails/msn.png"/></td>
		<td><?php echo $this->formAvancado->tipo;?></td>
		<td><br><input type="submit" name="PesquisaAvancada" id="PesquisaAvancada" value="Pesquisar" title="Pesquisa Avançada" style="font-weight:bold;" /></td>
	</tr>
</table>
</form>
</div>
<form id="buscaEmail" name="buscaEmail" method="post" action = <?php echo $this->url(array('action' => 'adiciona','controller' => 'emails','module' => 'admin',	));?>>
<table cellspacing="1" cellpadding="0" width="700px" border="0" style="text-align: right;">
	<tr>
		<td>
			<select name="lista" id="lista"><?php echo $this->optionListas;?></select>
			<input type="submit" name="Add_email_lista" id="add_email_lista" value="Adicionar e-mail selecionado na lista" title="adicionar e-mail" style="font-weight:bold;" />
		</td>
	</tr>

</table>
<table class="grid">
	<thead>
		<tr>
			<th><input type="checkbox" name="selecionaTodos" id="selecionaTodos" onchange="javascript:selecionar_todos_checkbox();"></th>
			<th>Nome</th>
			<th>E-mail</th>
			<th>Ação</th>
		</tr>
	</thead>
	<tbody>
       <?php foreach ($this->BuscaEmailPaginacao as $email) :?>
        <tr>
        	<td><input type="checkbox" name="email[]" id="email[]" value="<?php echo $email['idemail'];?>" /></td>
			<td><?php echo $email['nome'];?></td>
			<td><?php echo $email['email'];?></td>
			<td class="opcoes" width="10%">
				<a title="Editar" href="
					<?php echo $this->url(array(
						'action' => 'editar', 
						'controller' => 'emails',
						'module' => 'admin', 
						'id' => $email['idemail']));
					?>"><img border="0" src="/imagens/icons/email_edit.png"></a> |
					
						<a title="Excluír" href="javascript:void(0);" 
					onclick="poup('/admin/emails/excluir/id/',<?php echo $email['idemail'];?>);"><img border="0" src="/imagens/icons/email_delete.png"></a>
		  </td>
		</tr>
        <?php endforeach;?>
    </tbody>
</table>
</form>
<div id="confirme" title="<?php echo $translator->_('EXCLUIR_EMAIL');?>">
	<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><?php echo $translator->_('DELETAR_EMAIL');?></p>
</div>